<template>
	<div class="view">
		<template>
			<Top :title="'求职信息审核'"></Top>
		</template>
		<div class="main">
			<div class="main_con">
				<div class="main_title">求职信息审核</div>
				<div class="main_view">
					<el-form label-position="top" :model="form" ref="form">
						<el-form-item label="姓名" prop="seekerName">
							<el-input class="input" v-model="form.seekerName" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="性别" prop="seekerSex">
							<el-input class="input" v-model="form.seekerSex" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="生日" prop="seekerBirthday">
							<el-input class="input" v-model="form.seekerBirthday" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="联系方式" prop="seekerTel">
							<el-input class="input" v-model="form.seekerTel" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="学校" prop="seekerSchool">
							<el-input class="input" v-model="form.seekerSchool" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="专业" prop="seekerMajor">
							<el-input class="input" v-model="form.seekerMajor" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="学历" prop="seekerEducation">
							<el-input class="input" v-model="form.seekerEducation" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="求职行业" prop="hangye">
							<el-input class="input" v-model="form.hangye" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="求职岗位" prop="gangwei">
							<el-input class="input" v-model="form.gangwei" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="工作形式" prop="workType">
							<el-input class="input" v-model="form.workType" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="工作时间" prop="workTime">
							<el-input class="input" v-model="form.workTime" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="工作经验" prop="workExperience">
							<el-input class="input" v-model="form.workExperience" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="工作薪资" prop="workSalary">
							<el-input class="input" v-model="form.workSalary" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="薪资单位" prop="workDanwei">
							<el-input class="input" v-model="form.workDanwei" :disabled="true"></el-input>
						</el-form-item>
						<!-- <el-form-item label="工作省份" prop="province">
							<el-input class="input" v-model="form.province" :disabled="true"></el-input>
						</el-form-item>
						<el-form-item label="工作城市/区" prop="city">
							<el-input class="input" v-model="form.city" :disabled="true"></el-input>
						</el-form-item> -->
					</el-form>

				</div>
				<div class="saveBtn">
					<el-button type="primary" size="medium" @click="save(0)" :disabled="isAdd" v-if="this.form.status!=0">审核通过</el-button>
					<el-button type="danger" size="medium" @click="save(2)" :disabled="isAdd" v-if="this.form.status!=2">审核拒绝</el-button>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
import Top from "../../components/top.vue";
import { mapState } from "vuex"
export default {
	components: {
		Top
	},
	data() {
		return {
			form: {
				id: 0,         //主键

			},
			isAdd: false,

		}
	},
	computed: {
		...mapState(['urlParma'])
	},
	methods: {

		// 保存
		save(item) {
			this.$http({
				'method': 'post',
				'url': this.$api.jobStatus,
				data: {
					id:this.form.id,
					status:item
				}
			}).then(res => {
				if (res.data.code == 20000) {
					this.$message.success(res.data.message)
					this.$router.go(-1)
				} else {
					this.$message.error(res.data.message)
				}
				this.isAdd = false
			})
		},
		

		// 获取详情
		dataInit() {
			this.$http({
				'method': 'get',
				'url': this.$api.jobDetail + this.urlParma.id,
			}).then(res => {
				if (res.data.code == 20000) {
					console.log(res.data.data)
					let detail = res.data.data.detail
					let seeker = res.data.data.seeker

					this.form = detail

					this.form.seekerName = seeker.name
					this.form.seekerTel = seeker.tel
					this.form.seekerSex = seeker.sex
					this.form.seekerBirthday = seeker.birthday
					this.form.seekerSchool = seeker.school
					this.form.seekerMajor = seeker.major
					this.form.seekerEducation = seeker.education
				}
			})
		},

	},
	created() {
		this.dataInit()
	}
}
</script>

<style scoped>
@import url(../../assets/css/userAdd.css);
</style>
